<%-- 
    Document   : Image
    Created on : Apr 26, 2011, 11:10:26 AM
    Author     : Tiong Jia Ming
    Admin No   : 0900960
    Class      : DISM/FT/2A/02
--%>

<%@page import="java.sql.ResultSet"%>
<%@page import="DB.DBConnectionJm"%>
<%@page import="java.io.InputStreamReader"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="java.io.InputStream"%>
<%@page import="java.net.HttpURLConnection"%>
<%@page import="java.net.URL"%>
<%@page import="File.FileProperties"%>
<%@page import="File.Scribd"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
                    DBConnectionJm dbc = new DBConnectionJm();
                    dbc.setQuery("Select * from FileRecords");
                    if(request.getParameter("ID")!=null){
                    dbc.setAttributes(new String[]{request.getParameter("ID").toString()});
                    }
                    ResultSet rs = dbc.doQuery();
                    Scribd scribd = new Scribd();
                    while (rs.next()) {
                        out.println("<img src=\"" + scribd.getThumbnail(rs.getString("FileScribdID")) + "\"/>");
                    }
        %>
    </body>
</html>
